package org.sang;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<Position> positions = new ArrayList<>();
        int count = Integer.parseInt(scanner.nextLine().trim());
        if(count<4){
            System.out.println(0);
        } else {
            for(int i=0; i<count; i++){
                String line = scanner.nextLine();
                String[] numStr = line.trim().split(" ");
                int x = Integer.parseInt(numStr[0]);
                int y = Integer.parseInt(numStr[1]);
                Position position = new Position(i, x, y);
                positions.add(position);
            }
            int len = positions.size();
            int n = 0;
            for(int i=0; i<len-3; i++) {
                Position position1 = positions.get(i);
                Position position2 = positions.get(i+1);
                Position position3 = positions.get(i+2);
                Position position4 = positions.get(i+3);
                int a1 = position2.getX()-position1.getX();
                int b1 = position2.getY()-position1.getY();
                int val1 = a1*a1 + b1*b1;
                int a2 = position3.getX()-position2.getX();
                int b2 = position3.getY()-position2.getY();
                int val2 = a2*a2 + b2*b2;
                int a3 = position4.getX()-position3.getX();
                int b3 = position4.getY()-position3.getY();
                int val3 = a3*a3 + b3*b3;
                int a4 = position4.getX()-position1.getX();
                int b4 = position4.getY()-position1.getY();
                int val4 = a4*a4 + b4*b4;
                if(val1==val2 && val2==val3 && val3==val4){
                    n++;
                }
            }
            System.out.println(n);
        }
    }

    public static class Position {

        private int index;

        private int x;

        private int y;

        public Position(int index, int x, int y){
            this.index = index;
            this.x = x;
            this.y = y;
        }

        public void setX(int x){
            this.x = x;
        }

        public int getX(){
            return x;
        }

        public void setY(int y){
            this.y = y;
        }

        public int getY(){
            return y;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }
    }
}
